load("@fbsource//tools/build_defs:rust_binary.bzl", "rust_binary")

oncall("build_infra")

# Small binary to verify shell completion works correctly. Used in e2e tests of buck2.
rust_binary(
    name = "completion_verify",
    srcs = glob(["src/**/*.rs"]),
    compatible_with = [
        "ovr_config//os:linux",
        "ovr_config//os:macos",
    ],
    resources = select({
        "DEFAULT": {},
        "ovr_config//os:linux": {
            "fish": "//buck2/shed/completion_verify/packages:fish",
            "zsh": "//buck2/shed/completion_verify/packages:zsh",
        },
    }),
    deps = [
        "fbsource//third-party/rust:buck-resources",
        "fbsource//third-party/rust:clap",
        "fbsource//third-party/rust:ptyprocess",
        "fbsource//third-party/rust:tempfile",
        "fbsource//third-party/rust:vt100",
    ] + select({
        "DEFAULT": [],
        "ovr_config//os:linux": ["fbsource//third-party/rust:nix"],
        "ovr_config//os:macos": ["fbsource//third-party/rust:nix"],
    }),
)
